import {
	data
} from '../tuniao-ui/libs/mixin/mixin';
import request from '@/util/request/index.js';

import store from '@/store/index.js'
// import upload from '@/upload/upload.js';	


/**
 * @description  刷新token
 */
export function refreshToken(param) {
	return request({
		url: '/api/refresh-token/',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}


/**
 * @description  知乎热榜测试接口(z-paging刷新) 
 */
export function zhiHuHotListApi(param) {
	return request({
		url: '/api/v3/feed/topstory/hot-lists/total' + '?' + param,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}


/**
 * @description  修改用户信息
 */
export function modifyUserInfoApi(param) {
	return request({
		url: '/base_info_client_api/wxapp_user_edit',
		headers: {
			isToken: false,
		},
		method: 'PUT',
		data: param
	})
}

/**
 * @description  修改用户信息
 */
export function modifyUserInfoApiBypost(param) {
	return request({
		url: '/base_info_client_api/wxapp_user_edit',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}


/**
 * @description  头像上传
 * @abstract upload 上传请求
 */
export function headerImageUploadApi(param) {
	return upload({
		url: '/base_info_client_api/uploadAvatar',
		headers: {
			isToken: false,
		},
		name: param.name,
		filePath: param.avatarfile,
	})
}






/**
 * @description  验证码
 * @event register 注册
 * @mobile  手机号
 */

export function postShopSend(param) {
	return request({
		url: '/addons/shop/index/send',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}

/**
 * @description  注册
 * @code  验证码
 * @phone  手机号
 * @password  密码
 */

export function postShopSmsRegister(param) {
	return request({
		url: '/addons/shop/user.user/smsRegister',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}


/**
 * @description  登录
 * @account 手机号
 * @mobile password 手机号
 */

export function postAccountLogin(param) {
	return request({
		url: '/addons/shop/user.user/accountLogin',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}


/**
 * @description  验证码登录
 * @event code验证码
 * @mobile mobile 手机号
 */

export function postSmsLogin(param) {
	return request({
		url: '/addons/shop/user.user/smsLogin',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}


/**
 * @description  修改密码
 * @event 
 * @code: "1231"
 * @mobile: "18800004444"
 * @password: "123123a"
 * @mobile mobile 手机号
 */


export function postResetPassword(param) {
	return request({
		url: '/addons/shop/user.user/resetPassword',
		headers: {
			isToken: false,
		},
		method: 'post',
		data: param
	})
}

/**
 * @description  初始化
 */

export function getInit(param) {
	return request({
		url: '/addons/shop/index/init',
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  分类
 */

export function getShopAll(param) {
	return request({
		url: `/addons/shop/category/all?id=${param.id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  打折
 */
export function getGoodsIds(id) {
	return request({
		url: `/addons/shop/goods.goods/ids?ids=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  优惠券列表
 */
export function getCoupon(page, row) {
	return request({
		url: `/addons/shop/coupon?list_rows=${row}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}




/**
 * @description  领取优惠券
 */

export function getShopCoupon(id) {
	return request({
		url: `/addons/shop/coupon/get?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  已经领取使用失效
 */


export function getUserCoupon(used, size, page) {
	return request({
		url: `/addons/shop/user.coupon?type=${used}&list_rows=${size}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  排行榜and秒杀
 */


export function getShopGoodsActivity(id) {
	return request({
		url: `/addons/shop/goods.goods/activity?activity_id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  当前物品优惠券
 * 
 */
export function getListByGoods(id) {
	return request({
		url: `/addons/shop/coupon/listByGoods?goods_id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  当前物品详情
 * 
 */
export function getGoodsDetail(id) {
	return request({
		url: `/addons/shop/goods.goods/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}




/**
 * @description  当前物品评论
 * 
 */
export function getCommemtRow(id, size, page, type) {
	return request({
		url: `/addons/shop/goods.comment?goods_id=${id}&list_rows=${size}&page=${page}&type=${type}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}


/**
 * @description 物品评论筛选
 * 
 */
export function getCommemtTypeRow(id, type, size, page) {
	return request({
		url: `/addons/shop/goods.comment?goods_id=${id}&list_rows=${size}&page=${page}&type=${type}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}


/**
 * @description  加入购物车
 * 
 */
export function postShopupdate(param) {
	return request({
		url: `/addons/shop/cart/update`,
		headers: {
			isToken: false,
			'Content-Type': 'application/json'
		},
		method: 'POST',
		data: param
	})
}





/**
 * @description  获取地址
 * 
 */
export function getAddress(id) {
	return request({
		url: `/addons/shop/user.address/default`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  获取优惠券
 * 
 */
export function getOrderCoupons(data) {
	return request({
		url: `/addons/shop/order.order/coupons`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  获取购物卡
 * 
 */
export function getOrderCodes(data) {
	return request({
		url: `/addons/shop/order.order/codes`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  订单详情
 * 
 */
export function getOrderCalc(data) {
	return request({
		url: `/addons/shop/order.order/calc`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}


/**
 * @description  获取所有地址
 * 
 */
export function getUserAddress() {
	return request({
		url: `/addons/shop/user.address`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  新增地址
 * 
 */
export function getAddressAdd(data) {
	return request({
		url: `/addons/shop/user.address/add`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  获取修改的地址详情
 * 
 */
export function getAddressDetail(id) {
	return request({
		url: `/addons/shop/user.address/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  修改修改的地址详情
 * 
 */
export function getAddressDetailEdit(id, data) {
	return request({
		url: `/addons/shop/user.address/edit?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}




/**
 * @description  获取城市列表
 * 
 */
export function getDataArea(id, data) {
	return request({
		url: `/addons/shop/data.area`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}




/**
 * @description  获取城市列表
 * 
 */
export function getDataDelete(id) {
	return request({
		url: `/addons/shop/user.address/delete?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}





/**
 * @description  创建订单
 * 
 */
export function getOrderCreate(data) {
	return request({
		url: `/addons/shop/order.order/create`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}

/**
 * @description  订单详情
 * 
 */
export function getOrderDetail(id) {
	return request({
		url: `/addons/shop/order.order/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}





/**
 * @description  领取优惠券
 * 
 */
export function getShopCouponGet(id) {
	return request({
		url: `/addons/shop/coupon/get?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
	})
}



/**
 * @description  个人信息
 * 
 */
export function getUserProfile() {
	return request({
		url: `/addons/shop/user.user/profile`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  更改个人信息
 * 
 */
export function getUserUpdate(data) {
	return request({
		url: `/addons/shop/user.user/update`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}




/**
 * @description  订单
 * 
 */
export function getOrder(type, num, page) {
	return request({
		url: `/addons/shop/order.order?type=${type}&list_rows=${num}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  评价
 * 
 */
export function getOrderComment(data, id) {
	return request({
		url: `/addons/shop/order.order/comment?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}

/**
 * @description  收货
 * 
 */
export function getOrderConfirm(id) {
	return request({
		url: `/addons/shop/order.order/confirm?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			id: id
		}
	})
}

/**
 * @description  删除
 * 
 */
export function getOrderDelete(id) {
	return request({
		url: `/addons/shop/order.order/delete?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'delete',
	})
}


/**
 * @description  取消订单
 * 
 */
export function getOrderCancel(data) {
	return request({
		url: `/addons/shop/order.order/cancel?id=${data}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			id: data
		}
	})
}

/**
 * @description  优惠券数量
 * 
 */
export function getUserData(data) {
	return request({
		url: `/addons/shop/user.user/data`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  钱包记录
 * 
 */
export function getUserWalletLog(data) {
	return request({
		url: `/addons/shop/user.wallet_log?type=${data.type}&tab=${data.tab}&list_rows=${data.list_rows}&page=${data.page}&date[]=${data.createTime}&date[]=${data.endTime}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  实名信息
 * 
 */
export function getCardocrInfo(data) {
	return request({
		url: `/addons/shop/cardocr/info`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  提交审核
 * 
 */
export function getCommissionAgentApply(data) {
	return request({
		url: `/addons/shop/commission.agent/apply`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			data: data
		}
	})
}



/**
 * @description  审核状态
 * 
 */
export function getCommissionAgent(data) {
	return request({
		url: `/addons/shop/commission.agent`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  审核表单
 * 
 */
export function getCommissionAgentForm(data) {
	return request({
		url: `/addons/shop/commission.agent/form`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  实时状态
 * 
 */
export function getCommissionLog(page) {
	return request({
		url: `/addons/shop/commission.log?page=${page}&list_rows=10000`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  添加订单
 * 
 */
export function getRrderRecharge(data) {
	return request({
		url: `/addons/shop/trade.order/recharge`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}

/**
 * @description  获取订单详情
 * 
 */
export function getTradeOrderDetail(id) {
	return request({
		url: `/addons/shop/trade.order/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  支付
 * 
 */
export function getShopPayPrepay(data) {
	return request({
		url: `/addons/shop/pay/prepay`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}

/**
 * @description  浏览足迹
 * 
 */
export function getShopGoodsLog(size, page) {
	return request({
		url: `/addons/shop/user.goods_log?type=views&list_rows=${size}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}



/**
 * @description  浏览足迹
 * 
 */
export function getOrderApplyRefund(id) {
	return request({
		url: `/addons/shop/order.order/applyRefund?id=188`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			id: id
		}
	})
}




/**
 * @description  售后申请
 * 
 */
export function getOrderAftersaleAdd(data) {
	return request({
		url: `/addons/shop/order.aftersale/add`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  售后详情
 * 
 */
export function getOrderAftersaleDetail(id) {
	return request({
		url: `/addons/shop/order.aftersale/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}




/**
 * @description  取消售后
 * 
 */
export function getOrderAftersaleCancel(id) {
	return request({
		url: `/addons/shop/order.aftersale/cancel?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  购物车列表
 * 
 */
export function getShopCart() {
	return request({
		url: `/addons/shop/cart`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  更新购物车
 * 
 */
export function getShopCartDelete(id) {
	return request({
		url: `/addons/shop/cart/delete?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'delete',
		data: data
	})
}






/**
 * @description  购物车列表
 * 
 */
export function getShopOrderAftersale(type, size, page) {
	return request({
		url: `/addons/shop/order.aftersale?type=${type}&list_rows=${page}&page=${size}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  删除售后信息
 * 
 */
export function getShopOrderAftersaleDelete(id) {
	return request({
		url: `/addons/shop/order.aftersale/delete?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  取消售后信息
 * 
 */
export function getShopOrderAftersaleCancel(id) {
	return request({
		url: `/addons/shop/order.aftersale/cancel?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}









/**
 * @description  获取sessionId
 * 
 */
export function getThirdWechatSessionId(data) {
	return request({
		url: `/addons/shop/third.wechat/getSessionId`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  小程序登录
 * 
 */
export function getThirdWechatLogin(data) {
	return request({
		url: `/addons/shop/third.wechat/login?platform=miniProgram&shareInfo=${data.shareInfo}&payload=${data.payload}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data
	})
}


/**
 * @description  小程序绑定手机号
 * 
 */




export function getUserChangeMobile(data) {
	return request({
		url: `/addons/shop/user.user/changeMobile`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data
	})
}




/**
 * @description  购物车跳转到分类列表获取数据
 */
export function getShopGoodsGoods(data) {
	let page = null
	if (data.keyword) {
		page = `&page=${data.page}&keyword=${data.keyword}`
	} else {
		page = `&page=${data.page}`
	}
	return request({
		url: `/addons/shop/goods.goods?sort=${data.sort}&order=${data.order}&category_id=${data.category_id}&list_rows=${data.list_rows}${page}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  商品分类详情匪类
 */
export function getShopCategoryList(id) {
	return request({
		url: `/addons/shop/category/list?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}





/**
 * @description  申请退款
 * 
 */
export function getOrderApplyRefundMoney(id) {
	return request({
		url: `/addons/shop/order.order/applyRefund?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			id: id
		}
	})
}

/**
 * @description  足迹列表/收藏列表
 * 
 */
export function getUserGoodsLog(data) {
	return request({
		url: `/addons/shop/user.goods_log?type=${data.type}&list_rows=${data.list_rows}&page=${data.page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  删除足迹
 * 
 */
export function getGoodsLogViewDely(id) {
	return request({
		url: `/addons/shop/user.goods_log/viewDel`,
		headers: {
			isToken: false,
		},
		method: 'delete',
		data: {
			goods_id: id
		}
	})
}

/**
 * @description  收藏商品
 * 
 */
export function getGoodsLogFavorite(id) {
	return request({
		url: `/addons/shop/user.goods_log/favorite`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: {
			goods_id: id
		}
	})
}


/**
 * @description  问题反馈
 * 
 */
export function getShopFeedbacke(data) {
	return request({
		url: `/addons/shop/index/feedback`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  隐私协议
 * 
 */
export function getShopDataRichtext(id) {
	return request({
		url: `/addons/shop/data.richtext?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}


/**
 * @description  发票列表
 * 
 */
export function getShopUserInvoice(id) {
	return request({
		url: `/addons/shop/user.invoice`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}


/**
 * @description  发票详情
 * 
 */
export function getShopUserInvoiceDetail(id) {
	return request({
		url: `/addons/shop/user.invoice/detail?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get',
	})
}

/**
 * @description  修改发票详情
 * 
 */
export function postShopUserInvoiceEdit(data, id) {
	return request({
		url: `/addons/shop/user.invoice/edit?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}

/**
 * @description  新增发票详情
 * 
 */
export function postShopUserInvoiceAdd(data) {
	return request({
		url: `/addons/shop/user.invoice/add`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}


/**
 * @description  新增发票详情
 * 
 */
export function getShopUserInvoiceDelete(id) {
	return request({
		url: `/addons/shop/user.invoice/delete?id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'delete'
	})
}


/**
 * @description  分类列表商品
 * 
 */
export function getShopGoodsList(id, list_rows, page) {
	return request({
		url: `/addons/shop/goods.goods?sort=weigh&order=desc&category_id=${id}&list_rows=${list_rows}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  分销记录
 * 
 */
export function getShopShareList(data) {
	return request({
		url: `/addons/shop/share?list_rows=${data.list_rows}&page=${data.page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  分享记录
 * 
 */
export function getShopShareAdd(data) {
	return request({
		url: `/addons/shop/share/add`,
		headers: {
			isToken: false,
		},
		method: 'post'
	})
}

/**
 * @description  团队长员
 * 
 */
export function getAgentTeam(list_rows, page) {
	return request({
		url: `/addons/shop/commission.agent/team?list_rows=${list_rows}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  分销订单
 * 
 */
export function getCommissionOrder(type, list_rows, page) {
	return request({
		url: `/addons/shop/commission.order?type=${type}&list_rows=${list_rows}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}

/**
 * @description  佣金记录
 * 
 */
export function getShopWalletLog(obj) {
	return request({
		url: `/addons/shop/user.wallet_log?type=${obj.type}&tab=${obj.tab}&list_rows=${obj.list_rows}&page=${obj.page}&date[]=${obj.date[0]}&date[]=${obj.date[1]}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}





/**
 * @description  提现到余额
 * 
 */
export function getShopCommissionAgentTransfer(data) {
	return request({
		url: `/addons/shop/commission.agent/transfer`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}




/**
 * @description  提现到余额
 * 
 */

export function getShopCommissionGoodsList(list_rows, page) {
	return request({
		url: `/addons/shop/commission.goods?list_rows=8&page=1`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}


/**
 * @description  获取用户账户信息
 * 
 */

export function getShopUserAccount(type) {
	return request({
		url: `/addons/shop/user.account?type=${type}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}

/**
 * @description  保存提现信息
 * 
 */

export function getShopUserAccountSave(data) {
	return request({
		url: `/addons/shop/user.account/save`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}



/**
 * @description  提现信息
 * 
 */

export function getShopWithdrawApply(data) {
	return request({
		url: `/addons/shop/withdraw/apply`,
		headers: {
			isToken: false,
		},
		method: 'post',
		data: data
	})
}




/**
 * @description  提现记录
 * 
 */

export function getShopWithdrawListRow(list_rows, page) {
	return request({
		url: `/addons/shop/withdraw?list_rows=${list_rows}&page=${page}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}




/**
 * @description  物流信息
 * 
 */

export function getShopOrderExpress(id) {
	return request({
		url: `/addons/shop/order.express?order_id=${id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}



/**
 * @description  物流记录
 * 
 */

export function getShopOrderExpressDetail(id, order_id) {
	return request({
		url: `/addons/shop/order.express/detail?id=${id}&order_id=${order_id}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}





/**
 * @description  物流记录
 * 
 */

// export function getShopOrderExpressDetail(id,order_id){
// 	return request({
// 		url:`/addons/shop/order.express/detail?id=${id}&order_id=${order_id}`,
// 		headers: {
// 			isToken: false,
// 		},
// 		method: 'get'
// 	})
// }



/**
 * @description  微信小程序码
 * 
 */

export function getWechatWxacode(str) {
	let paths = {
		"path": str
	}
	const encodedPath = encodeURIComponent(JSON.stringify(paths));
	return request({
		url: `/addons/shop/third.wechat/wxacode?platform=miniProgram&payload=${encodedPath}`,
		method:'get'
	})
}



/**
 * @description  邀请记录
 * 
 */
export function getUserInviteLog(list_rows,page) {
	return request({
		url: `/addons/shop/user.user/inviteLog?list_rows=${list_rows}&page=${page}`,
		method:'get'
	})
}


/**
 * @description  充值选项
 * 
 */
export function getRechargeRules() {
	return request({
		url: `/addons/shop/trade.order/rechargeRules`,
		method:'get'
	})
}

/**
 * @description  vip选项
 * 
 */
export function getVipIndex() {
	return request({
		url: `/addons/vip/api.index/index`,
		method:'get'
	})
}


/**
 * @description  vip下单
 * 
 */
export function getTradeOrderVip(data) {
	return request({
		url: `/addons/shop/trade.order/vip`,
		method:'post',
		data: {
			data
		}
	})
}

/**
 * @description  修改用户名
 * 
 */
export function postChangeUsername(data) {
	return request({
		url: `/addons/shop/user.user/changeUsername`,
		method:'post',
		data: data
	})
}



/**
 * @description  小程序绑定
 * 
 */
export function postWechatBind() {
	let data={
		platform:'miniProgram',
		payload:encodeURIComponent(JSON.stringify({
			sessionId:store.state.sessionId
		}))
	}
	return request({
		url: `/addons/shop/third.wechat/bind?platform=${data.platform}&payload=${data.payload}`,
		method:'post',
		data: data
	})
}



/**
 * @description  小程序解绑
 * 
 */
export function postWechatUnbind(data) {
	return request({
		url: `/addons/shop/third.wechat/unbind?platform=${data.platform}`,
		method:'post',
		data: data
	})
}


/**
 * @description  vip购买记录
 * 
 */
export function getTradeOrderVipList(list_rows,page) {
	return request({
		url: `/addons/shop/trade.order?type=vip&list_rows=${list_rows}&page=${page}`,
		method:'get'
	})
}



/**
 * @description  上传实名信息
 * 
 */
export function getCardocrApply(data) {
	return request({
		url: `/addons/shop/cardocr/apply`,
		method:'post',
		data:data
	})
}


/**
 * @description  供应商信息详情
 * 
 */
export function getAgentInfo() {
	return request({
		url: `/addons/shop/agent/info`,
		method:'get',
	})
}

/**
 * @description  签到日期
 * 
 */
export function getActivitySignin(month) {
	let str=''
	if (month) {
		 str=`?month=${month}`
	}else{
		str=''
	}
	return request({
		url: `/addons/shop/activity.signin${str}`,
		method:'get',
	})
}


/**
 * @description  积分商城
 * 
 */
export function getScoreshopList(list_rows,page) {
	return request({
		url: `/addons/shop/app.score_shop?list_rows=${list_rows}&page=${page}`,
		method:'get',
	})
}


/**
 * @description  积分商品详情
 * 
 */
export function getScoreShop(id) {
	return request({
		url: `/addons/shop/app.score_shop/detail?id=${id}`,
		method:'get',
	})
}

/**
 * @description  签到
 * 
 */
export function getSigninSignin() {
	return request({
		url: `/addons/shop/activity.signin/signin`,
		method:'get',
	})
}



/**
 * @description  积分记录
 * 
 */
export function getUserWalletLogScore(data) {
	return request({
		url: `/addons/shop/user.wallet_log?type=${data.type}&tab=${data.tab}&list_rows=${data.list_rows}&page=${data.page}&date[]=${data.createTime}&date[]=${data.endTime}`,
		headers: {
			isToken: false,
		},
		method: 'get'
	})
}

/**
 * @description  红包签到日期
 * 
 */
export function getActivitySigninWeek() {
	return request({
		url: `/addons/shop/activity.redpacket/index`,
		method:'get',
	})
}

/**
 * @description  红包签到
 * 
 */
export function getActivitySigninSignin() {
	return request({
		url: `/addons/shop/activity.redpacket/signin`,
		method:'get',
	})
}



/**
 * @description  金币增加
 * 
 */
export function getActivitySigninIncScore(score) {
	return request({
		url: `/addons/shop/activity.redpacket/incCoin`,
		method:'post',
		data:{
			coin:score
		}
	})
}


/**
 * @description  经销商信息
 * 
 */
export function getUserApply() {
	return request({
		url: `/addons/shop/user.user/apply`,
		method:'get',
	})
}

/**
 * @description  经销商信息
 * 
 */
export function postShopApply(data) {
	return request({
		url: `/addons/shop/user.user/apply`,
		method:'post',
		data
	})
}

/**
 * @description  兑换红包列表
 * 
 */


export function getActivityScorecouponList() {
	return request({
		url: `/addons/shop/activity.redpacket/ScoreCouponList`,
		method:'get',
	})
}

/**
 * @description  兑换红包
 * 
 */

export function postShopExchangeScoreCoupon(id) {
	return request({
		url: `/addons/shop/activity.redpacket/exchangeScoreCoupon`,
		method:'post',
		data:{
			coupon_id:id
		}
	})
}

/**
 * @description  15秒浏览红包领取接口
 * 
 */

export function getReceiveViewCoupon(id) {
	return request({
		url: `/addons/shop/activity.redpacket/receiveViewCoupon`,
		method:'post',
		data:{
			coupon_id:id
		}
	})
}




/**
 * @description  浏览红包列表
 * 
 */

export function getViewCouponList() {
	return request({
		url: `/addons/shop/activity.redpacket/viewCouponList`,
		method:'get'
	})
}




